package ftp;

import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.Socket;

public class FtpClient {
	public static void main(String[] args) throws Exception{
		Socket socket=new Socket("127.0.0.1", 8888);
		InputStream is=socket.getInputStream();
		OutputStream os=new FileOutputStream("copya.txt",true);
		byte[] buffer=new byte[256];
		int len=0;
		while((len=is.read(buffer))!=-1){
			os.write(buffer, 0, len);
		}
		is.close();
		os.close();
		socket.close();
	}
}
 